package cn.iocoder.yudao.module.lfd.dal.mysql.appointmentitem;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.lfd.dal.dataobject.appointmentitem.AppointmentItemDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.lfd.controller.admin.appointmentitem.vo.*;

/**
 * 预约项目 Mapper
 *
 * @author 陈星星
 */
@Mapper
public interface AppointmentItemMapper extends BaseMapperX<AppointmentItemDO> {

    default PageResult<AppointmentItemDO> selectPage(AppointmentItemPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppointmentItemDO>()
                .eqIfPresent(AppointmentItemDO::getAppointmentId, reqVO.getAppointmentId())
                .eqIfPresent(AppointmentItemDO::getCostTime, reqVO.getCostTime())
                .eqIfPresent(AppointmentItemDO::getMoney, reqVO.getMoney())
                .likeIfPresent(AppointmentItemDO::getName, reqVO.getName())
                .betweenIfPresent(AppointmentItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppointmentItemDO::getId));
    }

    default List<AppointmentItemDO> selectList(AppointmentItemExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<AppointmentItemDO>()
                .eqIfPresent(AppointmentItemDO::getAppointmentId, reqVO.getAppointmentId())
                .eqIfPresent(AppointmentItemDO::getCostTime, reqVO.getCostTime())
                .eqIfPresent(AppointmentItemDO::getMoney, reqVO.getMoney())
                .likeIfPresent(AppointmentItemDO::getName, reqVO.getName())
                .betweenIfPresent(AppointmentItemDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppointmentItemDO::getId));
    }

}
